let allList = [{
    "auditStatus": 1,
    "auditTime": "2022-09-21 15:43:12.0",
    "optTime": "2022-09-21 15:43:12.0",
    "version": 1,
    "memo": "审核通过",
    "productName": "3-4人餐",
    "categoryName": "美食·地方菜·其他地方菜",
    "accountName": "杨再斌",
    "imgUrl": "[\"https://sf1-dycdn-tos.pstatp.com/obj/tos-cn-i-lgni0yg6nh/9698be28c847438a806421926fe6ab10\"]",
    "saleStartTime": "2022-09-21 13:44:57.0",
    "saleEndTime": "2022-10-31 13:44:57.0",
    "useStartTime": "2022-10-31 23:59:59.0",
    "useEndTime": "2022-09-21 00:00:00.0",
    "salePrice": 8800,
    "originPrice": 26800,
    "poiList": [{
        "name": "新贝乐意大利分享餐厅(苏宁广场店)",
        "address": "江苏省无锡市梁溪区人民中路111号无锡苏宁广场第6F层第605B号",
        "gdId": null,
        "outId": "188578",
        "dyId": "7039906348372346888"
    }, {
        "name": "新贝乐意大利分享餐厅(苏宁广场店)",
        "address": "江苏省无锡市梁溪区人民cdhfvj路111号无锡苏宁广场第6F层第605B号",
        "gdId": 121,
        "outId": "18857fwhj j8",
        "dyId": "70399063fwrmf48372346888"
    }],
    "info": "{\"EntrySchema\":\"{\\\"app_id\\\":\\\"tta73ed1833805f515\\\",\\\"params\\\":\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"856266\\\\\\\",\\\\\\\"idSign\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"dyId\\\\\\\":\\\\\\\"1302553\\\\\\\"}\\\",\\\"path\\\":\\\"pages/home/detail\\\"}\",\"can_no_use_date\":\"{\\\"enable\\\":true}\",\"rec_person_num_max\":\"1\",\"RefundPolicy\":\"1\",\"free_pack\":\"true\",\"use_time\":\"{\\\"use_time_type\\\":2,\\\"time_period_list\\\":[{\\\"use_start_time\\\":\\\"11:00:58\\\",\\\"use_end_time\\\":\\\"22:00:58\\\",\\\"end_time_is_next_day\\\":false}]}\",\"Images\":\"[\\\"https://sf1-dycdn-tos.pstatp.com/obj/tos-cn-i-lgni0yg6nh/9698be28c847438a806421926fe6ab10\\\"]\",\"appointment\":\"{\\\"need_appointment\\\":false}\",\"Notification\":\"[{\\\"title\\\":\\\"预约方式\\\",\\\"content\\\":\\\"1、无需预约，高峰期需等位\\\\n2、该团购产品不支持外卖\\\"},{\\\"title\\\":\\\"营业时间\\\",\\\"content\\\":\\\"1、周一至周日：11：00-22：00\\\"},{\\\"title\\\":\\\"使用规则\\\",\\\"content\\\":\\\"1、仅限堂食\\\\n2、周末节假日适用不加价\\\\n3、本套餐不可叠加使用\\\\n4、活动不可同时享受店里其他优惠活动，超出套餐内容费用，按店内实际收费另付\\\\n5、如部分菜品因时令或其他不可抗因素导致无法提供，商家将用等价菜品替换\\\"}]\",\"superimposed_discounts\":\"false\",\"SupplierExtIdList\":\"[\\\"227100\\\"]\",\"trade_url\":\"{\\\"app_id\\\":\\\"tta73ed1833805f515\\\",\\\"params\\\":\\\"{\\\\\\\"is_phone_necessary\\\\\\\":true,\\\\\\\"min_limits\\\\\\\":1,\\\\\\\"id\\\\\\\":\\\\\\\"856266\\\\\\\",\\\\\\\"use_template\\\\\\\":true,\\\\\\\"idSign\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"dyId\\\\\\\":\\\\\\\"1302553\\\\\\\"}\\\",\\\"path\\\":\\\"pages/home/detail\\\"}\",\"EntryType\":\"2\",\"rec_person_num\":\"1\",\"show_channel\":\"1\",\"OrderValidEnd\":\"1667231999\",\"OrderValidStart\":\"1663689600\",\"DateRule\":\"{\\\"unavailable_date\\\":{\\\"date_list\\\":[],\\\"weekday_list\\\":[],\\\"not_available_on_holidays\\\":false}}\",\"SubTitle\":\"过期退|随时退|免预约\",\"private_room\":\"false\",\"image_list\":\"[{\\\"url\\\":\\\"https://p3-sign.douyinpic.com/obj/tos-cn-i-lgni0yg6nh/9698be28c847438a806421926fe6ab10?x-expires=1663765200\\\\u0026x-signature=3W89dyDLBykm%2FdTzgH5hGx9UhaE%3D\\\\u0026from=709197913\\\"}]\",\"use_date\":\"{\\\"use_date_type\\\":1,\\\"use_start_date\\\":\\\"2022-09-21\\\",\\\"use_end_date\\\":\\\"2022-10-31\\\"}\"}",
    "productType": 1,
    "notification": "[{\"title\":\"预约方式\",\"content\":\"1、无需预约，高峰期需等位\\n2、该团购产品不支持外卖\"},{\"title\":\"营业时间\",\"content\":\"1、周一至周日：11：00-22：00\"},{\"title\":\"使用规则\",\"content\":\"1、仅限堂食\\n2、周末节假日适用不加价\\n3、本套餐不可叠加使用\\n4、活动不可同时享受店里其他优惠活动，超出套餐内容费用，按店内实际收费另付\\n5、如部分菜品因时令或其他不可抗因素导致无法提供，商家将用等价菜品替换\"}]",
    "appointment": "{\"need_appointment\":false}",
    "fee": 250,
    "dateRule": "{\"unavailable_date\":{\"date_list\":[],\"weekday_list\":[],\"not_available_on_holidays\":false}}"
}]

// function getTableData(poiList) {
//     let newPoiList = poiList.map((poi, i) => {
//         return {
//             key: i,
//             name: `抖音店铺名称:${poi.name}`,
//             adress: `抖音店铺地址:${poi.address}`,
//             gaodeId: `高德ID:${poi.gdId == null ? '无' : poi.gdId}`,
//             shanghuid: `外部商户ID: ${poi.outId}`,
//             tiktokPoi: `抖音POI_ID: ${poi.dyId}`
//         }
//     })
//     return newPoiList
// }

// function getFormatterDateRule(productItem) {
//     return JSON.parse(productItem.dateRule).unavailable_date
// }
// getFormatterDateRule(allList[0])

// 方案一：在子组件中监听父组件传递过来这个状态参数  参数状态改变的时候 重置子组件第一个按钮的样式
// 方案二：在父组件的显示子组件事件中 用this.$nextTick 
let dateRule = {
    unavailable_date: {
        date_list: ['2022-2-1至2022-2-3', '2022-2-1至2022-2-3', '2022-2-1至2022-2-3', '2022-2-1至2022-2-3', ],
        weekday_list: [3,6,8],
        not_available_on_holidays: false
    }
}
let unavailable_date = dateRule.unavailable_date
unavailable_date.date_list.forEach(item => {
    console.log('不可使用日期', item);
})

unavailable_date.weekday_list.forEach(item => {
    let weekList = []
    if (item < 1 || item > 7) {
        console.log('数据错误');
        return
    } else {
        switch (item) {
            case 1:
                weekList.push('周一')
                break
            case 2:
                weekList.push('周二')
                break
            case 3:
                weekList.push('周三')
                break

            case 4:
                weekList.push('周四')
                break

            case 5:
                weekList.push('周五')
                break

            case 6:
                weekList.push('周六')
                break

            case 7:
                weekList.push('周日')
                break


        }
        weekList.forEach(item => {
    console.log('不可使用周次',item);
            
        })
    }


})

unavailable_date.not_available_on_holidays === 'true' ? console.log('是') : console.log('否')